<template>
  <div class="search_container searchArea">
    <el-form
      :inline="true"
      :model="search_data"
      :rules="rules"
      ref="search_data"
      class="demo-form-inline search-form"
    >
      <div>
        <!-- <el-form-item label="名称">
          <el-input
            v-model="search_data.name"
            placeholder="请输入"
            class="short-input"
          ></el-input>
        </el-form-item> -->
        <!-- <el-form-item label="上牌时间筛选">
          <el-select
            clearable
            v-model="search_data.child"
            placeholder="请选择"
            class="short-input"
          >
            <el-option
              v-for="item in list1"
              :key="item.value"
              :label="item.name"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item> -->
        <!-- <el-form-item label="车龄筛选">
          <el-select
            clearable
            v-model="search_data.child"
            placeholder="请选择"
            class="short-input"
          >
            <el-option
              v-for="item in list5"
              :key="item.value"
              :label="item.name"
              :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item> -->
        <!-- <el-form-item>
          <el-button
            type="primary"
            size="mini"
            icon="search"
            @click="onScreeoutMoney('search_data')"
            >筛选</el-button
          >
        </el-form-item> -->
        <el-form-item class="btnRight">
          <el-button
            type="primary"
            size="mini"
            icon="view"
            @click="onAddMoney()"
            >添加1</el-button
          >
        </el-form-item>
      </div>
    </el-form>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import { getCategoryList, categorydel } from "@/api/user";

export default {
  name: "searchItem",
  data() {
    return {
      subBusinessList: [],
      list1: [],
      list2: [],
      list3: [],
      list4: [],
      list5: [],
      search_data: {
        // name: "",
      },
      rules: {
        name: [{ required: true, message: "请输入用户名", trigger: "blur" }],
      },
    };
  },
  computed: {
    ...mapGetters(["searchBtnDisabled"]),
  },
  created() {},
  methods: {
    onScreeoutMoney(searchForm) {
      this.$refs[searchForm].validate((valid) => {
        if (valid) {
          this.$store.commit("SET_SEARCH", this.search_data);
          this.$emit("searchList", this.search_data);
        }
      });
    },
    onAddMoney() {
      this.$emit("showDialog", "add");
    },
    onBatchDelMoney() {
      this.$emit("onBatchDelMoney");
    },
  },
};
</script>

<style lang="less" scoped>
.search_container {
  margin-bottom: 20px;
}
.btnRight {
  float: right;
  margin-right: 0px !important;
}
.searchArea {
  background: rgba(255, 255, 255, 1);
  border-radius: 2px;
  padding: 18px 18px 0;
}
</style>
